﻿imports System.Text 
Public Class clsLTRFDETRow
	inherits ADODBU.RowClass
	Private mVar_TRFLLINE As System.Int32
	Private mVar_TRFLCOD As System.String
	Private mVar_BARCODE As System.String
	Private mVar_TRFLART As System.String
	Private mVar_TRFLSIZE As System.String
	Private mVar_TRFLCOLOR As System.String
	Private mVar_TRFLCREQTY As System.Int32
	Private mVar_TRFLPICQTY As System.Int32
	Private mVar_TRFLRECQTY As System.Int32
	Private mVar_TRFLCRE As System.DateTime
	Private mVar_TRFLUTIL As System.String
	Private mVar_TRFLPROG As System.String
	Private mVar_DirtyTRFLLINE As Boolean=false 
	Private mVar_DirtyTRFLCOD As Boolean=false 
	Private mVar_DirtyBARCODE As Boolean=false 
	Private mVar_DirtyTRFLART As Boolean=false 
	Private mVar_DirtyTRFLSIZE As Boolean=false 
	Private mVar_DirtyTRFLCOLOR As Boolean=false 
	Private mVar_DirtyTRFLCREQTY As Boolean=false 
	Private mVar_DirtyTRFLPICQTY As Boolean=false 
	Private mVar_DirtyTRFLRECQTY As Boolean=false 
	Private mVar_DirtyTRFLCRE As Boolean=false 
	Private mVar_DirtyTRFLUTIL As Boolean=false 
	Private mVar_DirtyTRFLPROG As Boolean=false 
	Private mIsOnInit as Boolean 
	PUBLIC DataSource as ADODBU.Recordset 
	Public RowOrigin As clsLTRFDETRow
''[------------------------------------------------------------------------]'
	Public Sub New()
	RowOrigin=new clsLTRFDETRow(true)
	End Sub
''[------------------------------------------------------------------------]'
	Friend Sub New(lCut as boolean)
	 '--- untuk memutus loop reference 
	End Sub
	        ''[------------------------------------------------------------------------]'
	        ''' <summary>
	        ''' create new this class from inherited of this class or its self
	        ''' </summary>
	        ''' <param name="recdataRow"></param>
	        ''' <remarks></remarks>
	    Public Sub New(ByVal recdataRow As ADODBU.RowClass)
	        RowOrigin = New clsLTRFDETRow(True)
	        me.JoinValue(recdataRow)
	    End Sub
''[------------------------------------------------------------------------]'
	Public Sub New(recData as  ADODBU.Recordset)
	RowOrigin=new clsLTRFDETRow(true)
		DataSource = recData 
		try 
		InitVar( recdata.GetCurrentDataRow)
		Catch 
		end Try
	End Sub
 
''[------------------------------------------------------------------------]'
	Public Sub New(recdataRow as  DataRow)
	RowOrigin=new clsLTRFDETRow(true)
		InitVar( recdataRow)
	End Sub
 
#Region "Initialize vars "
''[------------------------------------------------------------------------]'
	private Sub InitVar(Fields as  DataRow)
		Try
			 mVar_TRFLLINE = Fields("TRFLLINE")
			 RowOrigin.TRFLLINE = mVar_TRFLLINE 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLCOD = Fields("TRFLCOD")
			 RowOrigin.TRFLCOD = mVar_TRFLCOD 
		Catch e as Exception
		End Try
		Try
			 mVar_BARCODE = Fields("BARCODE")
			 RowOrigin.BARCODE = mVar_BARCODE 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLART = Fields("TRFLART")
			 RowOrigin.TRFLART = mVar_TRFLART 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLSIZE = Fields("TRFLSIZE")
			 RowOrigin.TRFLSIZE = mVar_TRFLSIZE 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLCOLOR = Fields("TRFLCOLOR")
			 RowOrigin.TRFLCOLOR = mVar_TRFLCOLOR 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLCREQTY = Fields("TRFLCREQTY")
			 RowOrigin.TRFLCREQTY = mVar_TRFLCREQTY 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLPICQTY = Fields("TRFLPICQTY")
			 RowOrigin.TRFLPICQTY = mVar_TRFLPICQTY 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLRECQTY = Fields("TRFLRECQTY")
			 RowOrigin.TRFLRECQTY = mVar_TRFLRECQTY 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLCRE = Fields("TRFLCRE")
			 RowOrigin.TRFLCRE = mVar_TRFLCRE 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLUTIL = Fields("TRFLUTIL")
			 RowOrigin.TRFLUTIL = mVar_TRFLUTIL 
		Catch e as Exception
		End Try
		Try
			 mVar_TRFLPROG = Fields("TRFLPROG")
			 RowOrigin.TRFLPROG = mVar_TRFLPROG 
		Catch e as Exception
		End Try
	End Sub
 
 
#End Region 
''[------------------------------------------------------------------------]'
#Region "Properties"
		Public Property TRFLLINE As System.Int32
			Get
				Return mVar_TRFLLINE
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_TRFLLINE= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLLINE")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLLINE= True
				End if 
			End Set
		End Property
		Public Property TRFLCOD As System.String
			Get
				Return mVar_TRFLCOD
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLCOD= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLCOD")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLCOD= True
				End if 
			End Set
		End Property
		Public Property BARCODE As System.String
			Get
				Return mVar_BARCODE
			End Get
			Set(ByVal Value As System.String )
				mVar_BARCODE= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("BARCODE")) 
				IF Not mIsOnInit then 
					mVar_DirtyBARCODE= True
				End if 
			End Set
		End Property
		Public Property TRFLART As System.String
			Get
				Return mVar_TRFLART
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLART= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLART")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLART= True
				End if 
			End Set
		End Property
		Public Property TRFLSIZE As System.String
			Get
				Return mVar_TRFLSIZE
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLSIZE= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLSIZE")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLSIZE= True
				End if 
			End Set
		End Property
		Public Property TRFLCOLOR As System.String
			Get
				Return mVar_TRFLCOLOR
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLCOLOR= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLCOLOR")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLCOLOR= True
				End if 
			End Set
		End Property
		Public Property TRFLCREQTY As System.Int32
			Get
				Return mVar_TRFLCREQTY
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_TRFLCREQTY= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLCREQTY")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLCREQTY= True
				End if 
			End Set
		End Property
		Public Property TRFLPICQTY As System.Int32
			Get
				Return mVar_TRFLPICQTY
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_TRFLPICQTY= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLPICQTY")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLPICQTY= True
				End if 
			End Set
		End Property
		Public Property TRFLRECQTY As System.Int32
			Get
				Return mVar_TRFLRECQTY
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_TRFLRECQTY= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLRECQTY")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLRECQTY= True
				End if 
			End Set
		End Property
		Public Property TRFLCRE As System.DateTime
			Get
				Return mVar_TRFLCRE
			End Get
			Set(ByVal Value As System.DateTime )
				mVar_TRFLCRE= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLCRE")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLCRE= True
				End if 
			End Set
		End Property
		Public Property TRFLUTIL As System.String
			Get
				Return mVar_TRFLUTIL
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLUTIL= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLUTIL")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLUTIL= True
				End if 
			End Set
		End Property
		Public Property TRFLPROG As System.String
			Get
				Return mVar_TRFLPROG
			End Get
			Set(ByVal Value As System.String )
				mVar_TRFLPROG= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("TRFLPROG")) 
				IF Not mIsOnInit then 
					mVar_DirtyTRFLPROG= True
				End if 
			End Set
		End Property
		Public ReadOnly Property TRFLLINEIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLLINE
			End Get
		End Property
		Public ReadOnly Property TRFLCODIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLCOD
			End Get
		End Property
		Public ReadOnly Property BARCODEIsDirty As Boolean 
			Get
				Return mVar_DirtyBARCODE
			End Get
		End Property
		Public ReadOnly Property TRFLARTIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLART
			End Get
		End Property
		Public ReadOnly Property TRFLSIZEIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLSIZE
			End Get
		End Property
		Public ReadOnly Property TRFLCOLORIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLCOLOR
			End Get
		End Property
		Public ReadOnly Property TRFLCREQTYIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLCREQTY
			End Get
		End Property
		Public ReadOnly Property TRFLPICQTYIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLPICQTY
			End Get
		End Property
		Public ReadOnly Property TRFLRECQTYIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLRECQTY
			End Get
		End Property
		Public ReadOnly Property TRFLCREIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLCRE
			End Get
		End Property
		Public ReadOnly Property TRFLUTILIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLUTIL
			End Get
		End Property
		Public ReadOnly Property TRFLPROGIsDirty As Boolean 
			Get
				Return mVar_DirtyTRFLPROG
			End Get
		End Property
#End Region 
''[------------------------------------------------------------------------]'
	Public Function SaveToDataSource() as string
		dim msgErr as string 
		msgErr ="" 
		if mVar_DirtyTRFLLINE then 
		Try
			 DataSource.Fields("TRFLLINE") =  mVar_TRFLLINE 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLCOD then 
		Try
			 DataSource.Fields("TRFLCOD") =  mVar_TRFLCOD 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyBARCODE then 
		Try
			 DataSource.Fields("BARCODE") =  mVar_BARCODE 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLART then 
		Try
			 DataSource.Fields("TRFLART") =  mVar_TRFLART 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLSIZE then 
		Try
			 DataSource.Fields("TRFLSIZE") =  mVar_TRFLSIZE 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLCOLOR then 
		Try
			 DataSource.Fields("TRFLCOLOR") =  mVar_TRFLCOLOR 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLCREQTY then 
		Try
			 DataSource.Fields("TRFLCREQTY") =  mVar_TRFLCREQTY 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLPICQTY then 
		Try
			 DataSource.Fields("TRFLPICQTY") =  mVar_TRFLPICQTY 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLRECQTY then 
		Try
			 DataSource.Fields("TRFLRECQTY") =  mVar_TRFLRECQTY 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLCRE then 
		Try
			 DataSource.Fields("TRFLCRE") =  Format(mVar_TRFLCRE,DataSource.DbConn.DateFormat) 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLUTIL then 
		Try
			 DataSource.Fields("TRFLUTIL") =  mVar_TRFLUTIL 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyTRFLPROG then 
		Try
			 DataSource.Fields("TRFLPROG") =  mVar_TRFLPROG 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		return msgErr 
	End function
 
''[------------------------------------------------------------------------]'
	Public Sub ClearDirty
		 mVar_DirtyTRFLLINE = false
		 mVar_DirtyTRFLCOD = false
		 mVar_DirtyBARCODE = false
		 mVar_DirtyTRFLART = false
		 mVar_DirtyTRFLSIZE = false
		 mVar_DirtyTRFLCOLOR = false
		 mVar_DirtyTRFLCREQTY = false
		 mVar_DirtyTRFLPICQTY = false
		 mVar_DirtyTRFLRECQTY = false
		 mVar_DirtyTRFLCRE = false
		 mVar_DirtyTRFLUTIL = false
		 mVar_DirtyTRFLPROG = false
	End Sub
''[------------------------------------------------------------------------]'
	Public Sub SetDirty
		 mVar_DirtyTRFLLINE = true
		 mVar_DirtyTRFLCOD = true
		 mVar_DirtyBARCODE = true
		 mVar_DirtyTRFLART = true
		 mVar_DirtyTRFLSIZE = true
		 mVar_DirtyTRFLCOLOR = true
		 mVar_DirtyTRFLCREQTY = true
		 mVar_DirtyTRFLPICQTY = true
		 mVar_DirtyTRFLRECQTY = true
		 mVar_DirtyTRFLCRE = true
		 mVar_DirtyTRFLUTIL = true
		 mVar_DirtyTRFLPROG = true
	End Sub

End Class
